import { get, post } from '@/utils/request'
import type {
  LabelManager,
  LabelInsertManager,
  LabelUpdateManager,
  LabelRemoveManager,
} from '@/api/interface/labelManager'

export const queryLabelList = () => {
  return get<LabelManager.Result[]>('/label/query')
}

export const getLabelList = () => {
  return get<{ id: number; title: string }[]>('/label/list')
}

export const insertLabel = (params: LabelInsertManager) => {
  return post('/label/insert', params)
}

export const updateLabel = (params: LabelUpdateManager) => {
  return post('/label/update', params)
}

export const removeLabel = (params: LabelRemoveManager) => {
  return post('/label/remove', params)
}
